package com.robot.member.client;

import com.robot.member.client.impl.MerchantClientImpl;
import com.robot.member.pojo.client.Industry;
import com.robot.member.pojo.client.Store;
import entity.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @author lin
 */
@Component
@FeignClient(value = "robot-merchant", fallback = MerchantClientImpl.class)
public interface MerchantClient {
    /**
     * 查询所有的商家行业分类
     *
     * @return
     */
    @GetMapping(value = "industry/third/findIndustries", produces = "application/json; charset=utf-8")
    public String thirdFindIndustries();

    /**
     * 根据id查找行业
     *
     * @param id
     * @return
     */
    @GetMapping(value = "industry/third/findIndustryById/{id}", produces = "application/json; charset=utf-8")
    public String thirdFindIndustryById(@PathVariable String id);

    /**
     * 店铺列表
     *
     * @param searchMap
     * @param page
     * @param size
     * @return
     */
    @PostMapping(value = "store/third/findStores/{page}/{size}", produces = "application/json; charset=utf-8")
    public String thirdFindStores(@RequestBody Map searchMap, @PathVariable int page, @PathVariable int size);

    /**
     * 店铺详情
     *
     * @param id
     * @return
     */
    @GetMapping(value = "store/third/findStoreById/{id}", produces = "application/json; charset=utf-8")
    public String thirdFindStoreById(@PathVariable String id);

    /**
     * 通过phone查询店铺详情
     *
     * @param phone
     * @return
     */
    @GetMapping(value = "store/third/findStoreByPhone/{phone}", produces = "application/json; charset=utf-8")
    public String thirdFindStoreByPhone(@PathVariable String phone);
}
